package Others.DesignPattern.BuilderPattern.Original.Object;

import javax.swing.*;
import java.awt.*;

public class PersonPanel extends JPanel {
    @Override
    protected void paintComponent(Graphics g) {

        super.paintComponent(g);

        //场景：尝试构建出一个小人
        g.drawOval(50, 20, 30, 30);   // 头部
        g.drawRect(60, 50, 10, 50);    // 身体
        g.drawLine(60, 50, 30, 100);  // 左臂
        g.drawLine(70, 50, 90, 100);  // 右臂
        g.drawLine(60, 100, 45, 150); // 左腿
        g.drawLine(70, 100, 85, 150); // 右腿
    }
}
